package com.qbw.app.utils;

import android.content.Context;
import android.widget.TextView;

import com.github.mikephil.charting.components.MarkerView;
import com.github.mikephil.charting.data.CandleEntry;
import com.github.mikephil.charting.data.Entry;
import com.github.mikephil.charting.highlight.Highlight;
import com.lib.util.ToastUtil;
import com.qbw.app.R;
import com.qbw.app.model.TravelChart;

public class MyBarMarkerView extends MarkerView {
    private OnClickMarker onClickMarker;

    public MyBarMarkerView(Context context, int layoutResource) {
        super(context, layoutResource);
//        tvContent = (TextView) findViewById(R.id.tvContent);
    }

    @Override
    public void refreshContent(Entry e, Highlight highlight) {
        TravelChart travelChart = (TravelChart) e.getData();
        onClickMarker.onMarkerInfo(travelChart);
    }

    public interface OnClickMarker{
        void onMarkerInfo(TravelChart travelChart);
    }

    public OnClickMarker getOnClickMarker() {
        return onClickMarker;
    }

    public void setOnClickMarker(OnClickMarker onClickMarker) {
        this.onClickMarker = onClickMarker;
    }
}
